<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="API docs for the searchMsgFromDB method from the EMConversation class, for the Dart programming language.">
  <title>searchMsgFromDB method - EMConversation class - im_flutter_sdk library - Dart API</title>
  <!-- required because all the links are pseudo-absolute -->
  <base href="../..">

  <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700" rel="stylesheet">
  <link rel="stylesheet" href="static-assets/github.css">
  <link rel="stylesheet" href="static-assets/styles.css">
  <link rel="icon" href="static-assets/favicon.png">

</head>

<body>

<div id="overlay-under-drawer"></div>

<header id="title">
  <button id="sidenav-left-toggle" type="button">&nbsp;</button>
  <ol class="breadcrumbs gt-separated dark hidden-xs">
    <li><a href="index.html">im_flutter_sdk</a></li>
    <li><a href="im_flutter_sdk/im_flutter_sdk-library.html">im_flutter_sdk</a></li>
    <li><a href="im_flutter_sdk/EMConversation-class.html">EMConversation</a></li>
    <li class="self-crumb">searchMsgFromDB method</li>
  </ol>
  <div class="self-name">searchMsgFromDB</div>
  <form class="search navbar-right" role="search">
    <input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
</header>

<main>

  <div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
    <h5>EMConversation class</h5>
    <ol>
    
      <li class="section-title">
        <a href="im_flutter_sdk/EMConversation-class.html#instance-properties">Properties</a>
      </li>
      <li><a href="im_flutter_sdk/EMConversation/conversationId.html">conversationId</a></li>
      <li><a href="im_flutter_sdk/EMConversation/extField.html">extField</a></li>
      <li><a href="im_flutter_sdk/EMConversation/type.html">type</a></li>
      <li class="inherited"><a href="im_flutter_sdk/EMConversation/hashCode.html">hashCode</a></li>
      <li class="inherited"><a href="im_flutter_sdk/EMConversation/runtimeType.html">runtimeType</a></li>
    
      <li class="section-title"><a href="im_flutter_sdk/EMConversation-class.html#instance-methods">Methods</a></li>
      <li><a href="im_flutter_sdk/EMConversation/appendMessage.html">appendMessage</a></li>
      <li><a href="im_flutter_sdk/EMConversation/clear.html">clear</a></li>
      <li><a href="im_flutter_sdk/EMConversation/clearAllMessages.html">clearAllMessages</a></li>
      <li><a href="im_flutter_sdk/EMConversation/getLastMessage.html">getLastMessage</a></li>
      <li><a href="im_flutter_sdk/EMConversation/getLatestMessageFromOthers.html">getLatestMessageFromOthers</a></li>
      <li><a href="im_flutter_sdk/EMConversation/getMessage.html">getMessage</a></li>
      <li><a href="im_flutter_sdk/EMConversation/getUnreadMsgCount.html">getUnreadMsgCount</a></li>
      <li><a href="im_flutter_sdk/EMConversation/insertMessage.html">insertMessage</a></li>
      <li><a href="im_flutter_sdk/EMConversation/isGroup.html">isGroup</a></li>
      <li><a href="im_flutter_sdk/EMConversation/loadMoreMsgFromDB.html">loadMoreMsgFromDB</a></li>
      <li><a href="im_flutter_sdk/EMConversation/markAllMessagesAsRead.html">markAllMessagesAsRead</a></li>
      <li><a href="im_flutter_sdk/EMConversation/markMessageAsRead.html">markMessageAsRead</a></li>
      <li><a href="im_flutter_sdk/EMConversation/removeMessage.html">removeMessage</a></li>
      <li><a href="im_flutter_sdk/EMConversation/searchMsgFromDB.html">searchMsgFromDB</a></li>
      <li><a href="im_flutter_sdk/EMConversation/searchMsgFromDBByType.html">searchMsgFromDBByType</a></li>
      <li><a href="im_flutter_sdk/EMConversation/updateMessage.html">updateMessage</a></li>
      <li class="inherited"><a href="im_flutter_sdk/EMConversation/noSuchMethod.html">noSuchMethod</a></li>
      <li class="inherited"><a href="im_flutter_sdk/EMConversation/toString.html">toString</a></li>
    
      <li class="section-title inherited"><a href="im_flutter_sdk/EMConversation-class.html#operators">Operators</a></li>
      <li class="inherited"><a href="im_flutter_sdk/EMConversation/operator_equals.html">operator ==</a></li>
    
    
    
    </ol>
  </div><!--/.sidebar-offcanvas-->

  <div class="col-xs-12 col-sm-9 col-md-8 main-content">
    <h1>searchMsgFromDB method</h1>

    <section class="multi-line-signature">
      <span class="returntype">Future<span class="signature">&lt;<wbr><span class="type-parameter">List<span class="signature">&lt;<wbr><span class="type-parameter"><a href="im_flutter_sdk/EMMessage-class.html">EMMessage</a></span>&gt;</span></span>&gt;</span></span>
      <span class="name ">searchMsgFromDB</span>
(<wbr><span class="parameter" id="searchMsgFromDB-param-type"><span class="type-annotation"><a href="im_flutter_sdk/EMMessageType-class.html">EMMessageType</a></span> <span class="parameter-name">type</span>, </span> <span class="parameter" id="searchMsgFromDB-param-keywords"><span class="type-annotation">String</span> <span class="parameter-name">keywords</span>, </span> <span class="parameter" id="searchMsgFromDB-param-timeStamp"><span class="type-annotation">int</span> <span class="parameter-name">timeStamp</span>, </span> <span class="parameter" id="searchMsgFromDB-param-maxCount"><span class="type-annotation">int</span> <span class="parameter-name">maxCount</span>, </span> <span class="parameter" id="searchMsgFromDB-param-direction"><span class="type-annotation">EMSearchDirection</span> <span class="parameter-name">direction</span></span>)
      
    </section>
    <section class="desc markdown">
      <p>根据传入的参数从本地存储中搜索指定数量的消息
<code>type</code> 消息类型，文本、图片、语音等等
<code>keywords</code>, 搜索消息中的关键词
<code>timeStamp</code>,搜索消息的时间点
<code>maxCount</code> 搜索结果的最大条数
<code>direction</code>. 方向</p>
    </section>
    
    <section class="summary source-code" id="source">
      <h2><span>Implementation</span> </h2>
      <pre class="language-dart"><code class="language-dart">Future&lt;List&lt;EMMessage&gt;&gt; searchMsgFromDB(
  EMMessageType type,
  String keywords,
  int timeStamp,
  int maxCount,
  EMSearchDirection direction) async {
  Map&lt;String, dynamic&gt; result = await _emConversationChannel
      .invokeMethod(EMSDKMethod.searchConversationMsgFromDB, {
    &quot;id&quot;: _conversationId,
    &quot;type&quot;: type,
    &quot;keywords&quot;: keywords,
    &quot;timeStamp&quot;: timeStamp,
    &quot;maxCount&quot;: maxCount,
    &quot;direction&quot;: direction
  });
  if (result[&#39;success&#39;]) {
    var messages = List&lt;EMMessage&gt;();
    var _messages = result[&#39;messages&#39;];
    for (var message in _messages) {
      messages.add(EMMessage.from(message));
    }
    return messages;
  }
  return null;
}</code></pre>
    </section>

  </div> <!-- /.main-content -->

  <div class="col-xs-6 col-sm-6 col-md-2 sidebar sidebar-offcanvas-right">
  </div><!--/.sidebar-offcanvas-->

</main>

<footer>
  <span class="no-break">
    im_flutter_sdk 1.0.0
  </span>

</footer>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="static-assets/typeahead.bundle.min.js"></script>
<script src="static-assets/highlight.pack.js"></script>
<script src="static-assets/URI.js"></script>
<script src="static-assets/script.js"></script>


</body>

</html>
